home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / QWRITE.INC < prev    next >
Text File  |  1989-07-09  |  1KB  |  59 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * qWrite - quick write to screen
  15.  *
  16.  *)
  17.  
  18. procedure qWrite(x,y: integer; s: string);
  19.    {very fast dma string display}
  20. var
  21.   Vmode:       byte    absolute $0040:$0049;   {Current video mode}
  22.  
  23. {video modes}
  24. const
  25.   NoDisplay = $00;   VgaMono   = $07;
  26.   MdaMono   = $01;   VgaColor  = $08;
  27.   CgaColor  = $02;   DCC9      = $09;
  28.   DCC3      = $03;   DCC10     = $0A;
  29.   EgaColor  = $04;   McgaMono  = $0B;
  30.   EgaMono   = $05;   McgaColor = $0C;
  31.   PgcColor  = $06;   Unknown   = $FF;
  32.  
  33. type
  34.    screenloc = record
  35.       character: char;
  36.       attribute: byte;
  37.    end;
  38.  
  39.    videoram = array [1..2000] of screenloc;
  40.    videoptr = ^videoram;
  41.  
  42. var
  43.    disp_mem:   videoptr;
  44.    i:          integer;
  45.    bx:         integer;
  46.  
  47. begin
  48.    case Vmode of
  49.       MdaMono, VgaMono:
  50.          disp_mem := ptr($B000,0);
  51.       else
  52.          disp_mem := ptr($B800,0);
  53.    end;
  54.  
  55.    bx := 80*y+x-81;
  56.    for i := 1 to length(s) do
  57.       disp_mem^[bx+i].character := s[i];
  58. end;
  59.